#include <stdio.h>
#include <unistd.h>

#define IN 0
#define OUT 1
int main(){

  char buf[1];
  char bufout[10000];
  int flag = OUT,rdnum=-1,i=0;
  while(rdnum!=0){

    rdnum=read(0,buf,1);

    if(rdnum != 0){
      if(buf[0]==' '|| buf[0]=='\t'||buf[0]=='\n'){
        if(flag==IN){
          bufout[i]='\n';
          flag=OUT;
        }else{
          bufout[i]=buf[0];
        }
      }else{
        bufout[i]=buf[0];
        flag=IN;
      }

    }
    i++;
  }
  write(1,bufout,i+1);
  return 0;
}
